import request from '@/utils/request'

const product = {
  Directory: '/examdirectory/getExamDirectoryById',
  Add: '/studyPackageManage/addStudyPackageManage',
  Type: '/classType/selectClassTypeByExamId',
  Edit: '/studyPackageManage/updateStudyPackageManage',
  Deletes: '/studyPackageManage/deleteStudyPackageManage',
  Disable: '/studyPackageManage/updateStudyPackageManageByActive',
  ViewContent: '/studyPackageManage/selectStudyPackageContent',
  ViewInfo: '/studyPackageManage/selectStudyPackageInfo',
  List: '/studyPackageManage/selectStudyPackageManageList',
  Download: '/studyPackageManage/downloadStudyPackageTemplate',
  BulkImport: '/studyPackageManage/importStudyPackageBatch',
  CourseList: '/courseManage/selectCourseList',
  NotesList: '/lesson/selectHandoutListByStudyPackage',
  PaperList: '/examPaper/selectExamPaperListByStudyPackage',
  EditCopy: '/studyPackageManage/selectStudyPackageManageInfoByEdit'
}

/**
 * @param parameter
 * @returns {*}
 */

// 课程目录
export function directory (parameter) {
  return request({
    url: product.Directory,
    method: 'post',
    data: parameter
  })
}

// 课程类型
export function type (parameter) {
  return request({
    url: product.Type,
    method: 'post',
    data: parameter
  })
}

// 获取学习包列表
export function list (parameter) {
  return request({
    url: product.List,
    method: 'post',
    data: parameter
  })
}

// 添加学习包
export function add (parameter) {
  return request({
    url: product.Add,
    method: 'post',
    data: parameter
  })
}

// 编辑学习包
export function edit (parameter) {
  return request({
    url: product.Edit,
    method: 'post',
    data: parameter
  })
}

// 删除学习包
export function deletes (parameter) {
  return request({
    url: product.Deletes,
    method: 'post',
    data: parameter
  })
}

// 禁用学习包
export function disable (parameter) {
  return request({
    url: product.Disable,
    method: 'post',
    data: parameter
  })
}

// 查看学习包内容
export function viewContent (parameter) {
  return request({
    url: product.ViewContent,
    method: 'post',
    data: parameter
  })
}

// 查看学习包信息
export function viewInfo (parameter) {
  return request({
    url: product.ViewInfo,
    method: 'post',
    data: parameter
  })
}

// 下载批量导入学习包模板
export function download (parameter) {
  return request({
    url: product.Download,
    method: 'post',
    data: parameter
  })
}

// 批量导入学习包
export function bulkImport (parameter) {
  return request({
    url: product.BulkImport,
    method: 'post',
    data: parameter
  })
}

// 添加课程列表数据
export function courseList (parameter) {
  return request({
    url: product.CourseList,
    method: 'post',
    data: parameter
  })
}

// 添加讲义列表数据
export function notesList (parameter) {
  return request({
    url: product.NotesList,
    method: 'post',
    data: parameter
  })
}

// 添加试卷列表数据
export function paperList (parameter) {
  return request({
    url: product.PaperList,
    method: 'post',
    data: parameter
  })
}

// 编辑、复制，查看学习包信息
export function editCopy (parameter) {
  return request({
    url: product.EditCopy,
    method: 'post',
    data: parameter
  })
}
